home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / docs / howto / makeYourOwnKernel.me < prev    next >
Encoding:
Text File  |  1992-12-14  |  4.4 KB  |  96 lines

  1. .nr pp 12
  2. .nr sp 12
  3. .nr tp 12
  4. .lp
  5. .(l C
  6. \fBMaking Your Very Own Sprite Kernel\fP
  7. .sp
  8. Last Revised: 2/28/92
  9. .)l
  10. .sp
  11. .sh 1 "Background Information"
  12. .sh 2 "Kernel Sources"
  13. .pp
  14. The kernel sources are maintained by a home-grown source control system
  15. called \fBscvs\fP. The scvs cheat sheet (available in 
  16. \fC/sprite/admin/howto/scvs\fP) has lots of information on how to use
  17. scvs. The kernel sources are divided up into 32 different \fImodules\fP. 
  18. A list of these modules can be found in \fC/sprite/src/kernel/Modules\fP.
  19. Read-only copies of the kernel modules can be found in subdirectories of
  20. \fC/sprite/src/kernel\fP. 
  21. .sh 2 "Installed Object Files"
  22. .pp
  23. The read-only copies of the kernel sources are periodically compiled,
  24. and the resulting object files are stored in 
  25. \fC/sprite/src/kernel/\fImachine\fP.md\fR. These object files,
  26. can
  27. be linked together to build a kernel. 
  28. .sh 2 "Installed Kernels"
  29. .pp
  30. The "official" Sprite kernels are built in \fC/sprite/src/kernel/sprite\fR.
  31. The Makefile in that directory links together all of the installed
  32. object files to produce an official kernel. 
  33. .sh 1 "Making Your Own Kernel"
  34. .sh 2 "Your Personal Build Directory"
  35. .pp
  36. Sprite kernel developers have their own personal build directories in
  37. \fC/sprite/src/kernel\fP.  The name of the directory is usually the
  38. same as their login name.  To make your own kernel build directory
  39. go to \fC/sprite/src/kernel\fP and type \fBupdate newuser \fIlogin\fR,
  40. where \fIlogin\fP is your login name. (By the way, the \fBupdate\fP 
  41. program is really useful so you might want to check it out if you
  42. don't already know about it.)  Once the update completes go to
  43. your build directory and follow the instructions in the README file. 
  44. .sh 2 "Modifying a Module"
  45. .pp
  46. The \fBscvs\fP cheat sheet outlines how to make your own copy of
  47. a kernel modules and make modifications. To summarize, go to 
  48. the \fCsrc\fR subdirectory of your kernel build directory and
  49. type \fBscvs co \fImodule\fR. 
  50. Once you have your copy you need to create a Makefile for it.
  51. Go to the copy and type \fBmkmf\fP.  This will create a Makefile
  52. for you. If you add new files, or remove existing ones, then
  53. you will need to rerun \fBmkmf\fP. Tag files are created by
  54. typing \fBpmake tags\fP once you have a Makefile.
  55. .sh 2 "Building a Kernel"
  56. .pp
  57. Kernels are built by going to your kernel build directory and typing
  58. \fBpmake \fImachine\fR, where \fImachine\fP is the type of kernel
  59. that you want to build, e.g. ds5000. If you do not modify the object
  60. file list in your Makefile your kernel will be built out of the
  61. installed object files. If you want to use your own copy of a 
  62. module then you need to modify the Makefile (it has comments). 
  63. .pp
  64. There are few miscellaneous object files that are necessary to build a
  65. kernel. The first is version.o, which contains the kernel version
  66. string. The second is mainHook.o. This contains random variable definitions
  67. and strange routines.  I personally avoid modifying it. There are some
  68. variables that it may be useful to modify (like one that produces
  69. verbose information during the boot).  See the mainHook.c files for details.
  70. .sh 1 "Booting Your Kernel"
  71. .pp
  72. Your kernel will have the same name as your login.  To boot it, replace
  73. the "sprite" or "new" in the normal boot command for the machine with
  74. your kernel name.  For example, if your login name was \fBfoo\fP and you wanted
  75. to boot a ds5000 with your kernel you would type \fB boot 2/mop/foo\R.
  76. .sh 1 "Debugging Your Kernel"
  77. .pp
  78. You need to machines to debug a kernel; one runs the debugger and the other
  79. runs your kernel.
  80. To debug a machine it must be running the portion of the
  81. kernel that handles packets from the debugger running on the other machine
  82. (we refer to a machine in this state as "in the debugger"). 
  83. There are a number of ways of getting the machine into the debugger.
  84. One is to have a bug in the kernel. Another is to type \fBl1-d\fP
  85. at the console,
  86. and a third is to type \fBkmsg -d \fIhostname\fR from another machine.
  87. Once the machine is in the debugger you need to determine which kernel
  88. it is running. Either type \fBtail \fC/hosts/\fIhostname\fP/boottimes\fP,
  89. or type \fBkmsg -v \fIhostname\fR. 
  90. Go to your kernel build directory.  Do 
  91. \fBstrings \fIkernel\fP | grep VERSION\fR on your kernel and make sure it
  92. corresponds with the kernel that the machine was running. 
  93. If it does, then type \fBKgdb \fIkernel\fR. Once you get a debugger
  94. prompt type \fBattach \fIhostname\fR. It should print a message
  95. about dumping out the syslog, followed by a stack backtrace. 
  96.